<template>
  <div class="app-box">
    <h1>根组件</h1>
    <!-- 路由链接 -->
    <router-link to="/home" >首页</router-link>
    <router-link to="/about">关于</router-link>
    <router-link to="/mine">我的</router-link>
    <hr />
    <!-- 路由视图带简单动画 -->
    <transition name="simple-fade">
      <router-view></router-view>
    </transition>
  </div>
</template>

<script setup>
</script>

<style scoped>
.app-box {
  text-align: center;
  padding: 20px;
}

.app-box a {
  padding: 10px 15px;
  margin: 0 5px;
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.app-box a.router-link-active {
  color: #8a2be2;
}

.simple-fade-enter-active, .simple-fade-leave-active {
  transition: opacity 2s;
}

.simple-fade-enter-from, .simple-fade-leave-to {
  opacity: 0;
}
</style>
